home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / pgm_util / sealit / wizard / foo / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-01  |  7.8 KB  |  232 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "foo"
  6.    ClientHeight    =   2925
  7.    ClientLeft      =   3090
  8.    ClientTop       =   3585
  9.    ClientWidth     =   6255
  10.    ClipControls    =   0   'False
  11.    Height          =   3300
  12.    Left            =   3045
  13.    LinkTopic       =   "Form1"
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   2925
  16.    ScaleWidth      =   6255
  17.    Top             =   3255
  18.    Width           =   6345
  19.    Begin CommandButton cmdExit 
  20.       Caption         =   "Exit"
  21.       FontBold        =   0   'False
  22.       FontItalic      =   0   'False
  23.       FontName        =   "MS Sans Serif"
  24.       FontSize        =   8.25
  25.       FontStrikethru  =   0   'False
  26.       FontUnderline   =   0   'False
  27.       Height          =   330
  28.       Left            =   5040
  29.       TabIndex        =   5
  30.       Top             =   120
  31.       Width           =   1095
  32.    End
  33.    Begin Frame Frame1 
  34.       BackColor       =   &H00C0C0C0&
  35.       Caption         =   "Infomation"
  36.       FontBold        =   0   'False
  37.       FontItalic      =   0   'False
  38.       FontName        =   "MS Sans Serif"
  39.       FontSize        =   8.25
  40.       FontStrikethru  =   0   'False
  41.       FontUnderline   =   0   'False
  42.       Height          =   1935
  43.       Left            =   120
  44.       TabIndex        =   4
  45.       Top             =   120
  46.       Width           =   4815
  47.       Begin Label lblCompany 
  48.          BackColor       =   &H00C0C0C0&
  49.          BackStyle       =   0  'Transparent
  50.          FontBold        =   0   'False
  51.          FontItalic      =   0   'False
  52.          FontName        =   "MS Sans Serif"
  53.          FontSize        =   8.25
  54.          FontStrikethru  =   0   'False
  55.          FontUnderline   =   0   'False
  56.          Height          =   195
  57.          Left            =   480
  58.          TabIndex        =   0
  59.          Top             =   1560
  60.          Width           =   3855
  61.       End
  62.       Begin Label lblName 
  63.          BackStyle       =   0  'Transparent
  64.          FontBold        =   0   'False
  65.          FontItalic      =   0   'False
  66.          FontName        =   "MS Sans Serif"
  67.          FontSize        =   8.25
  68.          FontStrikethru  =   0   'False
  69.          FontUnderline   =   0   'False
  70.          Height          =   195
  71.          Left            =   480
  72.          TabIndex        =   1
  73.          Top             =   720
  74.          Width           =   3975
  75.       End
  76.       Begin Label Label1 
  77.          AutoSize        =   -1  'True
  78.          BackStyle       =   0  'Transparent
  79.          Caption         =   "Name"
  80.          FontBold        =   0   'False
  81.          FontItalic      =   0   'False
  82.          FontName        =   "MS Sans Serif"
  83.          FontSize        =   8.25
  84.          FontStrikethru  =   0   'False
  85.          FontUnderline   =   0   'False
  86.          Height          =   195
  87.          Left            =   240
  88.          TabIndex        =   2
  89.          Top             =   360
  90.          Width           =   420
  91.       End
  92.       Begin Label Label2 
  93.          AutoSize        =   -1  'True
  94.          BackStyle       =   0  'Transparent
  95.          Caption         =   "Company"
  96.          FontBold        =   0   'False
  97.          FontItalic      =   0   'False
  98.          FontName        =   "MS Sans Serif"
  99.          FontSize        =   8.25
  100.          FontStrikethru  =   0   'False
  101.          FontUnderline   =   0   'False
  102.          Height          =   195
  103.          Left            =   240
  104.          TabIndex        =   3
  105.          Top             =   1200
  106.          Width           =   660
  107.       End
  108.    End
  109.    Begin Label Label3 
  110.       AutoSize        =   -1  'True
  111.       BackStyle       =   0  'Transparent
  112.       Caption         =   "Today's Date:"
  113.       FontBold        =   0   'False
  114.       FontItalic      =   0   'False
  115.       FontName        =   "MS Sans Serif"
  116.       FontSize        =   8.25
  117.       FontStrikethru  =   0   'False
  118.       FontUnderline   =   0   'False
  119.       Height          =   195
  120.       Left            =   240
  121.       TabIndex        =   9
  122.       Top             =   2160
  123.       Width           =   990
  124.    End
  125.    Begin Label lblExpiresDate 
  126.       AutoSize        =   -1  'True
  127.       BackStyle       =   0  'Transparent
  128.       Caption         =   "1-3-95"
  129.       FontBold        =   0   'False
  130.       FontItalic      =   0   'False
  131.       FontName        =   "MS Sans Serif"
  132.       FontSize        =   8.25
  133.       FontStrikethru  =   0   'False
  134.       FontUnderline   =   0   'False
  135.       Height          =   195
  136.       Left            =   1440
  137.       TabIndex        =   6
  138.       Top             =   2400
  139.       Width           =   450
  140.    End
  141.    Begin Label Label4 
  142.       AutoSize        =   -1  'True
  143.       BackStyle       =   0  'Transparent
  144.       Caption         =   "Expires on:"
  145.       FontBold        =   0   'False
  146.       FontItalic      =   0   'False
  147.       FontName        =   "MS Sans Serif"
  148.       FontSize        =   8.25
  149.       FontStrikethru  =   0   'False
  150.       FontUnderline   =   0   'False
  151.       Height          =   195
  152.       Left            =   240
  153.       TabIndex        =   7
  154.       Top             =   2400
  155.       Width           =   780
  156.    End
  157.    Begin Label lblTodayDate 
  158.       AutoSize        =   -1  'True
  159.       BackStyle       =   0  'Transparent
  160.       Caption         =   "1-1-96"
  161.       FontBold        =   0   'False
  162.       FontItalic      =   0   'False
  163.       FontName        =   "MS Sans Serif"
  164.       FontSize        =   8.25
  165.       FontStrikethru  =   0   'False
  166.       FontUnderline   =   0   'False
  167.       Height          =   195
  168.       Left            =   1440
  169.       TabIndex        =   8
  170.       Top             =   2160
  171.       Width           =   450
  172.    End
  173. Option Explicit
  174. Sub cmdExit_Click ()
  175.     End
  176. End Sub
  177. Sub Form_Load ()
  178.     'center the window
  179.     CenterPopUpWindow Me
  180.     'display today date
  181.     lblTodayDate.Caption = Format(Now, "m-d-yy")
  182.     Show
  183.     Refresh
  184.     Initialize
  185. End Sub
  186. Sub Initialize ()
  187.     Dim wSealLen%
  188.     Dim wErr%
  189.     'initialize the gApplicationInfo type
  190.     gApplicationInfo.bOverWriteSeal = False                                         ' this field is ignored when reading the buffer
  191.     gApplicationInfo.szMagicString = "magicstring" & Chr$(0)                        ' the magic string which in this case is 'magicstring'
  192.     gApplicationInfo.szAppName = CurDir$ & "\" & App.EXEName & ".EXE" & Chr$(0)     ' the exename with a null chr$(0)
  193.     wSealLen% = Len(gfoo)
  194.     wErr% = ValidateApplication(gApplicationInfo, wSealLen%, gfoo)
  195.     If wErr% <> 0 Then
  196.         'Stop, an error
  197.         Dim szErrorString As String * 250
  198.         GetSealError wErr%, szErrorString
  199.         MsgBox szErrorString
  200.     Else
  201.         'HighLight bFirstTime and press Shift-F9.
  202.         'You will be able to see the value..
  203.         If gfoo.bFirstTime = True Then
  204.             frmRegister.Show 1
  205.         End If
  206.         Dim wMonth%, wDay%, wYear%
  207.         wErr% = ConvertDateFromLong(gfoo.dtExpirationDate, wMonth%, wDay%, wYear%)
  208.         If wErr% <> 0 Then
  209.             'this should never happen!
  210.         End If
  211.         If IsExpired(wMonth%, wDay%, wYear%) = False Then
  212.             lblCompany.Caption = strip_nulls(gfoo.szCompany)
  213.             lblName.Caption = strip_nulls(gfoo.szName)
  214.             lblExpiresDate.Caption = Format(wMonth% & "-" & wDay% & "-" & wYear%, "m-d-yy")
  215.         Else
  216.             MsgBox "foo had expired.", MB_ICONSTOP, "foo"
  217.             End
  218.         End If
  219.     End If
  220. End Sub
  221. Function IsExpired (wExMonth%, wExDay%, wExYear%)
  222.     Dim dtCurrent&, dtExpired&
  223.     dtCurrent& = Now
  224.     dtExpired& = DateValue(wExMonth% & "-" & wExDay% & "-" & wExYear%)
  225.     If dtCurrent& > dtExpired& Then
  226.         IsExpired = True
  227.     Else
  228.         IsExpired = False
  229.     End If
  230.         
  231. End Function
  232.